<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            border:1px solid #000
        }
        #menuDiv{
            width: 200px;
        }
        .head{
            background-color: #6ee7b7;
            text-align: center;
            height: 30px;
        }
        .body{
            background-color: yellow;
            text-align: center;
            height: 100px;
            display: none;
        }
    </style>

    <script>
        function showBody(divId){
            var divObj = document.getElementById(divId);
            if(divObj.style.display == "block"){
                divObj.style.display = "none";
            }
            else{
                divObj.style.display = "block";
            }
        }
    </script>
</head>
<body>
    <div id="menuDiv">
        <div class="head" onclick="showBody('friend')">好友</div>
        <div class="body" id="friend">
            韦小宝<br>
            陈近南<br>
            风际中
        </div>
        <div class="head" onclick="showBody('parent')">亲人</div>
        <div class="body" id="parent">
            向问天<br>
            令狐冲<br>
            胡一刀
        </div>
        <div class="head" onclick="showBody('black')">黑名单</div>
        <div class="body" id="black">
            岳不群<br>
            海大富<br>
            东方不败
        </div>
    </div>
</body>
</html>